-- 封装Seek行为

-- 模块定义
local M = 
{
	_base_class = require "ai.SteerBaseBehaviour",
	_class_name = "ai.SeekBehaviour"
}
setmetatable (M, {__index = _G;});
_ENV = M;

-- 引用模块
local Tools = require ("tools.CommonTools");
local SteerMethods = require ("ai.SteerMethods");

-- 方法定义
operation_table = Tools.CreateOperationTable (_base_class);

function operation_table.GetName (self)
	return "seek";
end

function operation_table.Update (self, currentTime, deltaTime)
	local steerComponent = self._steerComponent;
	return SteerMethods.Seek (steerComponent, steerComponent:GetSeekTargetPos ());
end
		
-- 构造方法
function NewSeekBehaviour (steerComponent)
	local instance = _base_class.NewObject (steerComponent);
	Tools.PrepareInstance (M, instance);
	return instance;
end;

return M;

